const {baseService} =require('../../baseService')
const modelBean =require('../../../dao/model/model')
const beansEnter=require('../../../beans/beansEnter')
/* 
记得在serviceEnter里注册一下
*/

/* 异常类 */
class kemuZhiyeServiceError extends Error {
    constructor(error,message='kemuZhiyeServiceError'){
        super()
        this.error = error
        this.message=message
    }
}


class kemuZhiyeService extends baseService{

    static ins = new kemuZhiyeService()

    constructor(){
        super(modelBean.modelkemuZhiye,beansEnter.kemuzhiye,kemuZhiyeServiceError)
    }

    static getIns (){
        if(this.ins){
            return this.ins
        }else{
            return new kemuZhiyeService()
        }
    }

    async  insertMany(data_arr){

    
        try {
            result  =  await new modelBean.modelkemuZhiye.insertMany(data_arr)
        } catch (error) {
            throw new kemuZhiyeServiceError(error)
        }
         if(result){
            return result
         }else{
            throw  new kemuZhiyeServiceError()
         }
    } 






}







module.exports={kemuZhiyeService}
